#include "Number.h"
#include <iostream>

Number::Number(double number)
{
	m_number = number;
	//m_string = 0;
}

Number::~Number()
{
	//if (m_string)
	//delete[] m_string;
}

double Number::operator-()
{
	return -m_number;
}

double Number::operator+(var& number)
{
	return m_number + (static_cast<Number&>(*number)).m_number;
}

double Number::operator-(var& number)
{
	return m_number - (static_cast<Number&>(*number)).m_number;
}

double Number::operator/(var& number)
{
	return m_number / (static_cast<Number&>(*number)).m_number;
}

double Number::operator*(var& number)
{
	return m_number * (static_cast<Number&>(*number)).m_number;
}

double Number::operator%(var& number)
{
	return (long)m_number % (long)(static_cast<Number&>(*number)).m_number;
}

double Number::operator+(double number)
{
	return m_number + number;
}

double Number::operator-(double number)
{
	return m_number - number;
}

double Number::operator/(double number)
{
	return m_number / number;
}

double Number::operator*(double number)
{
	return m_number * number;
}

double Number::operator%(double number)
{
	return (long)m_number % (long)number;
}


double Number::operator++()
{
	return ++m_number;
}

double Number::operator--()
{
	return --m_number;
}


const char* Number::toString()
{
	char* m_string = new char[10];
	sprintf(m_string,"%f",m_number);
	return m_string;
}


void Number::operator+=(double number)
{
	m_number += number;
}

void Number::operator-=(double number)
{
	m_number -= number;
}

void Number::operator/=(double number)
{
	m_number /= number;
}

void Number::operator*=(double number)
{
	m_number *= number;
}

void Number::operator%=(double number)
{
	m_number = (long)m_number % (long)number;
}


void Number::operator+=(var& number)
{
	m_number += (static_cast<Number&>(*number)).m_number;
}

void Number::operator-=(var& number)
{
	m_number -= (static_cast<Number&>(*number)).m_number;
}

void Number::operator/=(var& number)
{
	m_number /= (static_cast<Number&>(*number)).m_number;
}

void Number::operator*=(var& number)
{
	m_number *= (static_cast<Number&>(*number)).m_number;
}

void Number::operator%=(var& number)
{
	m_number = (long)m_number % (long)(static_cast<Number&>(*number)).m_number;
}

bool Number::operator ==(var& number)
{
	return m_number == (static_cast<Number&>(*number)).m_number;
}

bool Number::operator !=(var& number)
{
	return m_number != (static_cast<Number&>(*number)).m_number;
}

bool Number::operator <(var& number)
{
	return m_number < (static_cast<Number&>(*number)).m_number;
}

bool Number::operator >(var& number)
{
	return m_number > (static_cast<Number&>(*number)).m_number;
}

bool Number::operator <=(var& number)
{
	return m_number <= (static_cast<Number&>(*number)).m_number;
}

bool Number::operator >=(var& number)
{
	return m_number >= (static_cast<Number&>(*number)).m_number;
}


bool Number::operator <(double number)
{
	return m_number < number;
}

bool Number::operator >(double number)
{
	return m_number > number;
}

bool Number::operator <=(double number)
{
	return m_number <= number;
}

bool Number::operator >=(double number)
{
	return m_number >= number;
}

bool Number::operator ==(double number)
{
	return m_number == number;
}

bool Number::operator !=(double number)
{
	return m_number != number;
}
